<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<meta charset='utf-8' />
	<title>密码管理</title>
	<style>
		.cursers{cursor:pointer}
	</style>
</head>
<body style='background:#ddd;padding:0px;margin:0px;padding-left:10px'>
	<h1 style='text-align:center'>修改密码</h1>

	<div style='width:230px;border:0px solid;margin:0 auto'>
		<div style='margin:15px 0'>原密码：<input type="password" id='pwd1' /></div>
		<div style='margin:15px 0'>新密码：<input type="password" id='pwd2' /></div>
		<div style='margin:15px 0'>新密码：<input type="password" id='pwd3' /></div>
		<div style='position:relative'>
			验证码：<input type="text" style='width:50px' id='vcode' />
			<span style='position:absolute;left:130px;border:0px solid;width:90px;height:30px'><img id='vcodeImg' src="../interface/before_interface.php?type=code" style='width:100%;height:100%' onclick="this.src=this.src+'&t='+Math.random()" alt='点击' /></span>
		</div>

		<div style='margin:25px 0;text-align:center'>
			<button id='change' alt="点击">修改</button>
			<button onclick='history.go(-1)'>返回</button>
		</div>
	</div>
</body>
</html>
<script src='../public/jquery1.1.js'></script>
<script src='../public/fun.js'></script>
<script>


_checkExit();	//检测账号异常强制退出


$(function(){
	$('#change').click(function(){
		var pwd1 = m_trim($('#pwd1').val());
		var pwd2 = m_trim($('#pwd2').val());
		var pwd3 = m_trim($('#pwd3').val());
		var vcode = m_trim($('#vcode').val());
		if(!pwd1 || !pwd2 || !pwd3 || !vcode){
			A('缺少必填项！');return;
		}
		if(pwd2 != pwd3){
			A('两次新密码不一致！');return;
		}
		var data = {
			type:'changePassword',
			pwd1:pwd1,
			pwd2:pwd2,
			vcode:vcode
		}
		AjaxBefore(data,function(res){
			C(res);
			if(res == 10003){
				$('#vcodeImg').trigger('click');
			}
			var tmp = _checkJsonFormat(res); //检测JSON格式
			if(tmp.stat == 'ok'){
				A('密码修改成功！');
				history.go(-1);
			}else{
				A('密码修改失败！');
			}
		})
	});

});	
</script>

